package ui;

import gameLogic.GameThread;

import javax.swing.*;

public class GameFrame extends JFrame{
    public GameFrame(){
        setTitle("抓老婆");
        setSize(1000,800);
        setLocationRelativeTo(null);//设置窗口显示居中
        setResizable(false);//设置窗口大小不可改变
        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);//设置窗口默认关闭
        GamePanel panle = new GamePanel(this);
        GameThread thread = new GameThread(panle,panle.grasp,panle.wife);
        add(panle);
        setVisible(true);
        //重画线程和运动线程启动
        thread.getDrawing().start();
        thread.getMoveing().start();
    }
}
